<!DOCTYPE html><html><head>
      <title>readme</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:///c:\Users\A201\.vscode\extensions\shd101wyy.markdown-preview-enhanced-0.8.15\crossnote\dependencies\katex\katex.min.css">
      
      
      
      
      
      <style>
      code[class*=language-],pre[class*=language-]{color:#333;background:0 0;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.4;-moz-tab-size:8;-o-tab-size:8;tab-size:8;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.8em;overflow:auto;border-radius:3px;background:#f5f5f5}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal;background:#f5f5f5}.token.blockquote,.token.comment{color:#969896}.token.cdata{color:#183691}.token.doctype,.token.macro.property,.token.punctuation,.token.variable{color:#333}.token.builtin,.token.important,.token.keyword,.token.operator,.token.rule{color:#a71d5d}.token.attr-value,.token.regex,.token.string,.token.url{color:#183691}.token.atrule,.token.boolean,.token.code,.token.command,.token.constant,.token.entity,.token.number,.token.property,.token.symbol{color:#0086b3}.token.prolog,.token.selector,.token.tag{color:#63a35c}.token.attr-name,.token.class,.token.class-name,.token.function,.token.id,.token.namespace,.token.pseudo-class,.token.pseudo-element,.token.url-reference .token.variable{color:#795da3}.token.entity{cursor:help}.token.title,.token.title .token.punctuation{font-weight:700;color:#1d3e81}.token.list{color:#ed6a43}.token.inserted{background-color:#eaffea;color:#55a532}.token.deleted{background-color:#ffecec;color:#bd2c00}.token.bold{font-weight:700}.token.italic{font-style:italic}.language-json .token.property{color:#183691}.language-markup .token.tag .token.punctuation{color:#333}.language-css .token.function,code.language-css{color:#0086b3}.language-yaml .token.atrule{color:#63a35c}code.language-yaml{color:#183691}.language-ruby .token.function{color:#333}.language-markdown .token.url{color:#795da3}.language-makefile .token.symbol{color:#795da3}.language-makefile .token.variable{color:#183691}.language-makefile .token.builtin{color:#0086b3}.language-bash .token.keyword{color:#0086b3}pre[data-line]{position:relative;padding:1em 0 1em 3em}pre[data-line] .line-highlight-wrapper{position:absolute;top:0;left:0;background-color:transparent;display:block;width:100%}pre[data-line] .line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}pre[data-line] .line-highlight:before,pre[data-line] .line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}pre[data-line] .line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}html body{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ol,html body>ul{margin-bottom:16px}html body ol,html body ul{padding-left:2em}html body ol.no-list,html body ul.no-list{padding:0;list-style-type:none}html body ol ol,html body ol ul,html body ul ol,html body ul ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:700;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::after,html body code::before{letter-spacing:-.2em;content:'\00a0'}html body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:0 0;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:after,html body pre code:before,html body pre tt:after,html body pre tt:before{content:normal}html body blockquote,html body dl,html body ol,html body p,html body pre,html body ul{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body code,html body pre{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview ul{list-style:disc}.markdown-preview ul ul{list-style:circle}.markdown-preview ul ul ul{list-style:square}.markdown-preview ol{list-style:decimal}.markdown-preview ol ol,.markdown-preview ul ol{list-style-type:lower-roman}.markdown-preview ol ol ol,.markdown-preview ol ul ol,.markdown-preview ul ol ol,.markdown-preview ul ul ol{list-style-type:lower-alpha}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([data-for=preview]) .code-chunk .code-chunk-btn-group{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .status{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0;min-height:100vh}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}@media print{html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc{padding:0 16px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 300px / 2);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

      </style>
      <!-- The content below will be included at the end of the <head> element. --><script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
    // your code here
  });
</script></head><body for="html-export">
    
    
      <div class="crossnote markdown-preview  ">
      
<h1 id="uesdk">UESDK </h1>
<p>三维SDK</p>
<h1 id="核心类core">核心类（Core） </h1>
<hr>
<h3 id="引入">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> initUePixelStreaming<span class="token punctuation">,</span> addEventListener<span class="token punctuation">,</span> removeEventListener <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Core/connect'</span><span class="token punctuation">;</span>
</code></pre><h4 id="方法列表">方法列表 </h4>
<ul>
<li>initUePixelStreaming---初始化三维场景</li>
<li>addEventListener---增加像素流监听</li>
<li>removeEventListener---移除像素流监听</li>
<li>getStream---获取像素流</li>
</ul>
<h5 id="inituepixelstreaming参数列表">initUePixelStreaming参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>像素流地址</td>
</tr>
<tr>
<td>dom</td>
<td>HTMLElement</td>
<td>渲染器场景容器</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="html" class="language-html html"><code><span class="token comment">&lt;!--创建的三维窗口--&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>container<span class="token punctuation">"</span></span> <span class="token special-attr"><span class="token attr-name">style</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token value css language-css"><span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span></span><span class="token punctuation">"</span></span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> ueDom <span class="token operator">=</span> <span class="token dom variable">document</span><span class="token punctuation">.</span><span class="token method function property-access">getElementById</span><span class="token punctuation">(</span><span class="token string">'totals'</span><span class="token punctuation">)</span> <span class="token keyword module keyword-as">as</span> <span class="token maybe-class-name">HTMLElement</span> <span class="token comment">//获取容器</span>
<span class="token keyword keyword-const">const</span> url <span class="token operator">=</span> <span class="token string">'ws://localhost:80'</span>
<span class="token function">initUePixelStreaming</span><span class="token punctuation">(</span>url<span class="token punctuation">,</span> ueDom<span class="token punctuation">)</span> <span class="token comment">//不改变焦点移动相机</span>
</code></pre><h5 id="addeventlistener参数列表">addEventListener参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>streams</td>
<td>PixelStreaming</td>
<td>像素流</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">initUePixelStreaming</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Core/connect'</span>
<span class="token keyword keyword-const">const</span> streams <span class="token operator">=</span> <span class="token function">initUePixelStreaming</span><span class="token punctuation">(</span><span class="token string">'ws://localhost:80'</span><span class="token punctuation">,</span> ueDom<span class="token punctuation">)</span>
<span class="token function">addEventListener</span><span class="token punctuation">(</span>streams<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
   
<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="removeeventlistener参数列表">removeEventListener参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>streams</td>
<td>PixelStreaming</td>
<td>像素流</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">initUePixelStreaming</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Core/connect'</span>
<span class="token keyword keyword-const">const</span> streams <span class="token operator">=</span> <span class="token function">initUePixelStreaming</span><span class="token punctuation">(</span><span class="token string">'ws://localhost:80'</span><span class="token punctuation">,</span> ueDom<span class="token punctuation">)</span>
<span class="token function">removeEventListener</span><span class="token punctuation">(</span>streams<span class="token punctuation">)</span>
</code></pre><h5 id="getstream参数列表">getStream参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token function">getStream</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="相机类camera">相机类（Camera） </h1>
<h3 id="引入-1">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Camera</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">"../Camera/Camera"</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myCamera <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Camera</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-1">方法列表 </h4>
<ul>
<li>getCameraMatrix---获取相机参数(矩阵)</li>
<li>flyToLonLat---通过地理坐标飞行定位相机位置</li>
<li>flyToWorld---通过世界坐标飞行定位相机位置</li>
<li>lock---相机锁定</li>
<li>unlock---相机解锁</li>
<li>setAutogiration---相机沿视图中心自动旋转</li>
<li>setCameraBoundBox---镜头范围限制</li>
<li>setUnderground---相机是否可进入地下</li>
<li>setCameraType---设置相机模式</li>
<li>refreshCamera---重置场景初始镜头</li>
</ul>
<h5 id="getcameramatrix参数列表">getCameraMatrix参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myCamera<span class="token punctuation">.</span><span class="token method function property-access">getCameraMatrix</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">//获取相机矩阵</span>
</code></pre><h5 id="setcameraboundbox参数列表">setCameraBoundBox参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>positionA</td>
<td>Vector3</td>
<td>左上角坐标</td>
</tr>
<tr>
<td>positionB</td>
<td>Vector3</td>
<td>右下角坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> left <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.0</span><span class="token punctuation">,</span> <span class="token number">24.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> right <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">115.0</span><span class="token punctuation">,</span> <span class="token number">23.0</span><span class="token punctuation">,</span> <span class="token number">0.0</span><span class="token punctuation">)</span>
myCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraBoundBox</span><span class="token punctuation">(</span>left<span class="token punctuation">,</span>right<span class="token punctuation">)</span>
</code></pre><h5 id="flytolonlat参数列表">flyToLonLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>相机坐标</td>
</tr>
<tr>
<td>pitch</td>
<td>number</td>
<td>相机俯仰角</td>
</tr>
<tr>
<td>yaw</td>
<td>number</td>
<td>相机偏向角</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">111.588745</span><span class="token punctuation">,</span><span class="token number">28.791234</span><span class="token punctuation">,</span><span class="token number">491286.246862</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> pitch <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">67.0</span>
<span class="token keyword keyword-const">const</span> yaw <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">70.0</span>
myCamera<span class="token punctuation">.</span><span class="token method function property-access">flyToLonLat</span><span class="token punctuation">(</span>position<span class="token punctuation">,</span> pitch<span class="token punctuation">,</span> yaw<span class="token punctuation">)</span>
</code></pre><h5 id="flytoworld参数列表">flyToWorld参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>相机坐标</td>
</tr>
<tr>
<td>pitch</td>
<td>number</td>
<td>相机俯仰角</td>
</tr>
<tr>
<td>yaw</td>
<td>number</td>
<td>相机偏向角</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token operator">-</span><span class="token number">275440.0</span><span class="token punctuation">,</span><span class="token number">1036160.0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">428000.0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> pitch <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">67.0</span>
<span class="token keyword keyword-const">const</span> yaw <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">70.0</span>
myCamera<span class="token punctuation">.</span><span class="token method function property-access">flyToWorld</span><span class="token punctuation">(</span>position<span class="token punctuation">,</span> pitch<span class="token punctuation">,</span> yaw<span class="token punctuation">)</span>
</code></pre><h5 id="lock参数列表">lock参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myCamera<span class="token punctuation">.</span><span class="token method function property-access">lock</span><span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment">//锁定相机，不可移动</span>
</code></pre><h5 id="unlock参数列表">unlock参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myCamera<span class="token punctuation">.</span><span class="token method function property-access">unlock</span><span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment">//解锁相机，可移动</span>
</code></pre><hr>
<h1 id="副相机类devicecamera">副相机类（DeviceCamera） </h1>
<h3 id="引入-2">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">DeviceCamera</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../Base/DeviceCamera'</span>
</code></pre><h3 id="初始化-1">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-var">var</span> <span class="token literal-property property">deviceCamera</span><span class="token operator">:</span> <span class="token maybe-class-name">DeviceCamera</span>
    deviceCamera <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DeviceCamera</span><span class="token punctuation">(</span>
        <span class="token punctuation">{</span>
            <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'name1'</span><span class="token punctuation">,</span>
            <span class="token literal-property property">vieoPosition</span> <span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token literal-property property">CameraPostion</span> <span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">6342330.0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">11466610.0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">130310.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token literal-property property">CameraRotate</span> <span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token literal-property property">VisualAngle</span><span class="token operator">:</span><span class="token string">'90'</span><span class="token punctuation">,</span>
            <span class="token literal-property property">CameraType</span><span class="token operator">:</span><span class="token string">'1'</span><span class="token punctuation">,</span>
            <span class="token literal-property property">VideoSize</span><span class="token operator">:</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span>
    deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">getCameraMatrix</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">res</span><span class="token arrow operator">=&gt;</span><span class="token punctuation">{</span>
        <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-2">方法列表 </h4>
<ul>
<li>getCameraMatrix---获取副相机矩阵</li>
<li>setCameraPosition---设置副相机位置</li>
<li>setCameraRotate---设置副相机旋转</li>
<li>setVideoPosition---设置副相机画面位置</li>
<li>setVideoSize---设置副相机画面尺寸</li>
<li>setCameraType---设置副相机类型（正交/透视），与参数</li>
<li>setCameraLookAt---设置副相机朝向</li>
<li>setCameraLookActor---设置副相机朝向对象（可锁定）</li>
<li>unlockCameraLookActor---解除副相机对象锁定</li>
<li>setCameraFolowActor---设置副相机跟随对象</li>
<li>removeCamerFolow---解除副相机对象跟随</li>
<li>destroy---销毁副相机</li>
</ul>
<h5 id="getcameramatrix参数列表-1">getCameraMatrix参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">getCameraMatrix</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">//获取相机矩阵</span>
</code></pre><h5 id="setcameraposition参数列表">setCameraPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>CameraPostion</td>
<td>Vector3</td>
<td>相机坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">111.588745</span><span class="token punctuation">,</span><span class="token number">28.791234</span><span class="token punctuation">,</span><span class="token number">491286.246862</span><span class="token punctuation">)</span>
 deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraPosition</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="setcamerarotate参数列表">setCameraRotate参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>CameraRotate</td>
<td>Vector3</td>
<td>相机旋转坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> <span class="token maybe-class-name">CameraRotate</span> <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">90</span><span class="token punctuation">)</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraRotate</span><span class="token punctuation">(</span><span class="token maybe-class-name">CameraRotate</span><span class="token punctuation">)</span>
</code></pre><h5 id="setvideoposition参数列表">setVideoPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>vieoPosition</td>
<td>Vector2</td>
<td>副相机画面位置</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> vieoPosition <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setVideoPosition</span><span class="token punctuation">(</span>vieoPosition<span class="token punctuation">)</span>
</code></pre><h5 id="setvideosize参数列表">setVideoSize参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>VideoSize</td>
<td>Vector2</td>
<td>副相机画面尺寸</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">VideoSize</span> <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span><span class="token number">200</span><span class="token punctuation">)</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setVideoSize</span><span class="token punctuation">(</span><span class="token maybe-class-name">VideoSize</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcameratype参数列表">setCameraType参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>CameraType</td>
<td>string</td>
<td>副相机类型</td>
</tr>
<tr>
<td>VisualAngle</td>
<td>string</td>
<td>相机参数</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 透视相机相关</span>
<span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">CameraType</span> <span class="token operator">=</span> <span class="token string">'Perspective'</span><span class="token comment">//透视相机</span>
<span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">VisualAngle</span> <span class="token operator">=</span> <span class="token string">'90'</span><span class="token comment">//相机可视角度</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraType</span><span class="token punctuation">(</span><span class="token maybe-class-name">CameraType</span><span class="token punctuation">,</span><span class="token maybe-class-name">VisualAngle</span><span class="token punctuation">)</span>

<span class="token comment">// 正交相机相关</span>
<span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">CameraType</span> <span class="token operator">=</span> <span class="token string">'Orthographic'</span><span class="token comment">//透视相机</span>
<span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">VisualAngle</span> <span class="token operator">=</span> <span class="token string">'5000'</span><span class="token comment">//相机可视角度</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraType</span><span class="token punctuation">(</span><span class="token maybe-class-name">CameraType</span><span class="token punctuation">,</span><span class="token maybe-class-name">VisualAngle</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcameralookat参数列表">setCameraLookAt参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>lookPos</td>
<td>Vector3</td>
<td>副相机朝向坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> lookPos <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">6341330.0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">11466610.0</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">130310.0</span><span class="token punctuation">)</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraLookAt</span><span class="token punctuation">(</span>lookPos <span class="token punctuation">)</span>
</code></pre><h5 id="setcameralookactor参数列表">setCameraLookActor参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>ActorName</td>
<td>string</td>
<td>副相机看向对象名</td>
</tr>
<tr>
<td>lockflag</td>
<td>boolean</td>
<td>副相机是否锁定对象</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">ActorName</span> <span class="token operator">=</span> <span class="token string">'cube'</span>
<span class="token keyword keyword-let">let</span> lockflag <span class="token operator">=</span> <span class="token boolean">true</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraLookActor</span><span class="token punctuation">(</span><span class="token string">'cube'</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">)</span>
</code></pre><h5 id="unlockcameralookactor参数列表">unlockCameraLookActor参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">ActorName</span> <span class="token operator">=</span> <span class="token string">'cube'</span>
<span class="token keyword keyword-let">let</span> lockflag <span class="token operator">=</span> <span class="token boolean">true</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraLookActor</span><span class="token punctuation">(</span><span class="token string">'cube'</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcamerafolowactor参数列表">setCameraFolowActor参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>ActorName</td>
<td>string</td>
<td>副相机跟随对象名</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-let">let</span> <span class="token maybe-class-name">ActorName</span> <span class="token operator">=</span> <span class="token string">'cube'</span>
deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">setCameraFolowActor</span><span class="token punctuation">(</span><span class="token maybe-class-name">ActorName</span><span class="token punctuation">)</span>
</code></pre><h5 id="removecamerfolow参数列表">removeCamerFolow参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>    deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">removeCamerFolow</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="destroy参数列表">destroy参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>    deviceCamera<span class="token punctuation">.</span><span class="token method function property-access">destroy</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="object3d类object3d">Object3D类（Object3D） </h1>
<h3 id="引入-3">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Object3D</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">"../Object3D/Object3D"</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-2">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myObject3D <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Object3D</span><span class="token punctuation">(</span> 
    <span class="token punctuation">{</span>
        <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'exampleName'</span><span class="token punctuation">,</span>
        <span class="token literal-property property">groupId</span><span class="token operator">:</span> <span class="token string">'myObject3D1'</span><span class="token punctuation">,</span>
        <span class="token literal-property property">position</span><span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token comment">//坐标</span>
        <span class="token literal-property property">rotate</span><span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span>   <span class="token comment">//旋转</span>
        <span class="token literal-property property">size</span><span class="token operator">:</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span>      <span class="token comment">//大小</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-3">方法列表 </h4>
<ul>
<li>setVisible---根据uuid控制指定对象显隐</li>
<li>setGroupVisible---根据groupId控制一组对象显隐</li>
<li>setAllVisible---控制所有对象显隐</li>
<li>setGroupId---设置组ID</li>
<li>setPosition---设置位置</li>
<li>setRotate---设置旋转</li>
<li>setSize---根据缩放</li>
<li>getMatrix---获取对象矩阵</li>
<li>delete---根据uuid删除指定对象</li>
<li>remove---根据groupId删除指定一组对象</li>
<li>clear---删除所有对象</li>
</ul>
<h5 id="setvisible参数列表">setVisible参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>visibleType</td>
<td>visibleType</td>
<td>显隐性</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> visibleType <span class="token operator">=</span> <span class="token number">1</span> <span class="token comment">//1为隐藏0为显示</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">visibleType</span><span class="token punctuation">(</span>visibleType<span class="token punctuation">)</span>
</code></pre><h5 id="setgroupvisible参数列表">setGroupVisible参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>visibleType</td>
<td>visibleType</td>
<td>显隐性</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> visibleType <span class="token operator">=</span> <span class="token number">1</span> <span class="token comment">//1为隐藏0为显示</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setGroupVisible</span><span class="token punctuation">(</span>visibleType<span class="token punctuation">)</span>
</code></pre><h5 id="setallvisible参数列表">setAllVisible参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>visibleType</td>
<td>visibleType</td>
<td>显隐性</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> visibleType <span class="token operator">=</span> <span class="token number">1</span> <span class="token comment">//1为隐藏0为显示</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setAllVisible</span><span class="token punctuation">(</span>visibleType<span class="token punctuation">)</span>
</code></pre><h5 id="setgroupid参数列表">setGroupId参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>组ID</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> id <span class="token operator">=</span> <span class="token string">'myObject3D1'</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setGroupId</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span>
</code></pre><h5 id="setposition参数列表">setPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>坐标向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setPosition</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="setrotate参数列表">setRotate参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>旋转向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setRotate</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="setsize参数列表">setSize参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>大小向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span>
myObject3D<span class="token punctuation">.</span><span class="token method function property-access">setSize</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="getmatrix参数列表">getMatrix参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myObject3D<span class="token punctuation">.</span><span class="token method function property-access">getMatrix</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="delete参数列表">delete参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myObject3D<span class="token punctuation">.</span><span class="token method function property-access">delete</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="remove参数列表">remove参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myObject3D<span class="token punctuation">.</span><span class="token method function property-access">remove</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="clear参数列表">clear参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myObject3D<span class="token punctuation">.</span><span class="token method function property-access">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="glb类glb">Glb类（Glb） </h1>
<h3 id="引入-4">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Glb</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/Glb'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-3">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myglb <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Glb</span><span class="token punctuation">(</span><span class="token string">'myglb'</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-4">方法列表 </h4>
<ul>
<li>setUrl---通过url加载模型</li>
<li>clearGlb---移除模型</li>
<li>setLongLatPosition---设置模型位置</li>
<li>getGlbByName---通过名字获取模型</li>
<li>StopAnimation---模型动画停止</li>
<li>StartAnimation---模型动画开始</li>
<li>getGlbNode---获取GLB模型子树</li>
</ul>
<h5 id="seturl参数列表">setUrl参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>模型网址</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myglb<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'http://10.0.0.153:8080/uva.glb'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter"><span class="token literal-property property">val</span><span class="token operator">:</span>any</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="clearglb参数列表">clearGlb参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myglb<span class="token punctuation">.</span><span class="token method function property-access">clearGlb</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="setlonglatposition参数列表">setLongLatPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>坐标向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setLongLatPosition</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="getglbbyname参数列表">getGlbByName参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>模型名称</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> name <span class="token operator">=</span> <span class="token string">'myglb'</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">getGlbByName</span><span class="token punctuation">(</span>name<span class="token punctuation">)</span>
</code></pre><h5 id="setclick参数列表">setClick参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>click</td>
<td>string</td>
<td>事件开关</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> click <span class="token operator">=</span> <span class="token string">'1'</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setClick</span><span class="token punctuation">(</span>click<span class="token punctuation">)</span>
</code></pre><h5 id="stopanimation参数列表">StopAnimation参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myglb<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">StopAnimation</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="startanimation参数列表">StartAnimation参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myglb<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">StartAnimation</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="三维瓦片类tileset">三维瓦片类（Tileset） </h1>
<h3 id="引入-5">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tileset</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/loadTileset'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-4">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> mytileset <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Tileset</span><span class="token punctuation">(</span><span class="token string">'dianyun'</span><span class="token punctuation">,</span><span class="token string">'http://localhost:8090/dm/tileset.json'</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-5">方法列表 </h4>
<ul>
<li>setLongLat---设置瓦片位置</li>
</ul>
<h5 id="setlonglat参数列表">setLongLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>any</td>
<td>坐标向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">113.8</span><span class="token punctuation">,</span><span class="token number">31.25</span><span class="token punctuation">,</span><span class="token number">20000.0</span><span class="token punctuation">)</span>
mytileset<span class="token punctuation">.</span><span class="token method function property-access">setLongLat</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="面类polygon">面类（Polygon） </h1>
<h3 id="引入-6">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Polygon</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">"../Object3D/Polygon"</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-5">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myPolygon <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Polygon</span><span class="token punctuation">(</span><span class="token string">'myPolygon'</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-6">方法列表 </h4>
<ul>
<li>setMaterial---设置材质</li>
<li>build---构造几何</li>
</ul>
<h5 id="setmaterial参数列表">setMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>material</td>
<td>material</td>
<td>材质</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Material</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Material/Material'</span>
<span class="token keyword keyword-const">const</span> material <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Material</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.5</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
myPolygon<span class="token punctuation">.</span><span class="token method function property-access">setMaterial</span><span class="token punctuation">(</span>material<span class="token punctuation">)</span>
</code></pre><h5 id="build参数列表">build参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myPolygon<span class="token punctuation">.</span><span class="token method function property-access">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="spline类spline">Spline类（Spline） </h1>
<h3 id="引入-7">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Spline</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/spline'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-6">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> mySpline <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Spline</span><span class="token punctuation">(</span><span class="token string">'mySpline1'</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-7">方法列表 </h4>
<ul>
<li>clickAddSpline---鼠标点击构线</li>
<li>addPointList---坐标数组构线</li>
<li>addPipeByList---坐标数组构实体线(UE坐标)</li>
<li>addPipeByCoorList---坐标数组构实体线(经纬度)</li>
<li>deletePipe---删除实体线</li>
<li>changeSplineWidth---修改线条宽度</li>
<li>changeSplineMaterial---修改线条材质</li>
<li>addPoint---指点游标添加点</li>
<li>removeIndexPoint---指点游标删除点</li>
<li>moveActorBySpline---指定物体沿线移动</li>
<li>changeState---修改运动状态</li>
<li>changeSpeed---修改运动速度</li>
<li>setNewTime---指定时刻下的物体位置</li>
</ul>
<h5 id="clickaddspline参数列表">clickAddSpline参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>clickAddSpline</td>
<td>Number</td>
<td>线条宽度</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> lindwidth <span class="token operator">=</span> <span class="token number">10</span>
<span class="token comment">// 用户Alt+鼠标左键点击绘线，Alt+鼠标右键结束绘线</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">clickAddSpline</span><span class="token punctuation">(</span>lindwidth<span class="token punctuation">)</span>
</code></pre><h5 id="addpointlist参数列表">addPointList参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>pointList</td>
<td>Array<vector3></vector3></td>
<td>坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
</code></pre><h5 id="removeindexpoint参数列表">removeIndexPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>string</td>
<td>点的index</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> index <span class="token operator">=</span> <span class="token string">'0'</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">removeIndexPoint</span><span class="token punctuation">(</span>index<span class="token punctuation">)</span>
</code></pre><h5 id="addpipebylist参数列表">addPipeByList参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>pointList</td>
<td>Array<vector3></vector3></td>
<td>管道的向量数组</td>
</tr>
<tr>
<td>Material</td>
<td>Object</td>
<td>材质对象</td>
</tr>
<tr>
<td>materialType</td>
<td>string</td>
<td>材质类型</td>
</tr>
<tr>
<td>width</td>
<td>string</td>
<td>样条宽度</td>
</tr>
<tr>
<td>pipeType</td>
<td>pipeType</td>
<td>样条形状</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword keyword-const">const</span> splineMaterial <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">LightMaterial</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPipeByList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'1000'</span><span class="token punctuation">,</span> splineMaterial<span class="token punctuation">,</span><span class="token string">'LightMaterial'</span><span class="token punctuation">,</span><span class="token string">'square'</span><span class="token punctuation">)</span>
</code></pre><h5 id="removeindexpoint参数列表-1">removeIndexPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>string</td>
<td>点的index</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> index <span class="token operator">=</span> <span class="token string">'0'</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">removeIndexPoint</span><span class="token punctuation">(</span>index<span class="token punctuation">)</span>
</code></pre><h5 id="deletepipe参数列表">deletePipe参数列表 </h5>
<p>|name|类型|描述|</p>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword keyword-const">const</span> splineMaterial <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">LightMaterial</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPipeByList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'1000'</span><span class="token punctuation">,</span> splineMaterial<span class="token punctuation">,</span><span class="token string">'LightMaterial'</span><span class="token punctuation">,</span><span class="token string">'square'</span><span class="token punctuation">)</span>
<span class="token comment">// 添加实体管道（addPipeByList）后使用</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">deletePipe</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="changesplinewidth参数列表">changeSplineWidth参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>String</td>
<td>宽度值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword keyword-const">const</span> splineMaterial <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">LightMaterial</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPipeByList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'1000'</span><span class="token punctuation">,</span> splineMaterial<span class="token punctuation">,</span><span class="token string">'LightMaterial'</span><span class="token punctuation">,</span><span class="token string">'square'</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">changeSplineWidth</span><span class="token punctuation">(</span><span class="token string">'100'</span><span class="token punctuation">)</span>
</code></pre><h5 id="changesplinematerial参数列表">changeSplineMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material</td>
<td>Material</td>
<td>基础材质</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token keyword keyword-const">const</span> splineMaterial <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">LightMaterial</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPipeByList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'1000'</span><span class="token punctuation">,</span> splineMaterial<span class="token punctuation">,</span><span class="token string">'LightMaterial'</span><span class="token punctuation">,</span><span class="token string">'square'</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> waterma <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">WaterMaterial</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">1</span> <span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">changeSplineMaterial</span><span class="token punctuation">(</span>waterma<span class="token punctuation">,</span><span class="token string">'WaterMaterial'</span><span class="token punctuation">)</span>
</code></pre><h5 id="addpoint参数列表">addPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>坐标向量</td>
</tr>
<tr>
<td>index</td>
<td>string</td>
<td>点的index</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPoint</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'0'</span><span class="token punctuation">)</span>
</code></pre><h5 id="removeindexpoint参数列表-2">removeIndexPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>string</td>
<td>点的index</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">removeIndexPoint</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">,</span><span class="token string">'0'</span><span class="token punctuation">)</span>
</code></pre><h5 id="moveactorbyspline参数列表">moveActorBySpline参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>actorId</td>
<td>string</td>
<td>移动物体的uuid</td>
</tr>
<tr>
<td>speed</td>
<td>Number</td>
<td>物体移动速度</td>
</tr>
<tr>
<td>cameraFollow</td>
<td>boolean</td>
<td>相机是否跟随</td>
</tr>
<tr>
<td>cameraFollowDistance</td>
<td>Number</td>
<td>跟随相机距离物体xyz距离</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
<span class="token comment">// 加载模型（地址动态调整），相机跟随模型运动</span>
<span class="token keyword keyword-const">const</span> myglb <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Glb</span><span class="token punctuation">(</span><span class="token string">'cs'</span><span class="token punctuation">)</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'http://10.0.0.124:8081/uva.glb'</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">moveActorBySpline</span><span class="token punctuation">(</span>myglb<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token number">68000</span><span class="token punctuation">)</span>
</code></pre><h5 id="changestate参数列表">changeState参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>actorState</td>
<td>运动状态</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
<span class="token comment">// 加载模型（地址动态调整），相机跟随模型运动</span>
<span class="token keyword keyword-const">const</span> myglb <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Glb</span><span class="token punctuation">(</span><span class="token string">'cs'</span><span class="token punctuation">)</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'http://10.0.0.124:8081/uva.glb'</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">moveActorBySpline</span><span class="token punctuation">(</span>myglb<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token number">68000</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">changeState</span><span class="token punctuation">(</span><span class="token string">'stop'</span><span class="token punctuation">)</span>
</code></pre><h5 id="changespeed参数列表">changeSpeed参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>newSpeed</td>
<td>Number</td>
<td>新速度值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
<span class="token comment">// 加载模型（地址动态调整），相机跟随模型运动</span>
<span class="token keyword keyword-const">const</span> myglb <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Glb</span><span class="token punctuation">(</span><span class="token string">'cs'</span><span class="token punctuation">)</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'http://10.0.0.124:8081/uva.glb'</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">moveActorBySpline</span><span class="token punctuation">(</span>myglb<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token number">68000</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">changeSpeed</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre><h5 id="changespeed参数列表-1">changeSpeed参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>newTime</td>
<td>Number</td>
<td>时刻值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> pointPositions <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">1.0</span><span class="token punctuation">)</span>，<span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">,</span><span class="token number">2.0</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">addPointList</span><span class="token punctuation">(</span>pointPositions<span class="token punctuation">)</span>
<span class="token comment">// 加载模型（地址动态调整），相机跟随模型运动</span>
<span class="token keyword keyword-const">const</span> myglb <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Glb</span><span class="token punctuation">(</span><span class="token string">'cs'</span><span class="token punctuation">)</span>
myglb<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'http://10.0.0.124:8081/uva.glb'</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">moveActorBySpline</span><span class="token punctuation">(</span>myglb<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token number">68000</span><span class="token punctuation">)</span>
mySpline<span class="token punctuation">.</span><span class="token method function property-access">setNewTime</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="精灵图类sprite">精灵图类（Sprite） </h1>
<h3 id="引入-8">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Sprite</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">"../Object3D/Sprite"</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-7">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> mySprite <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Sprite</span><span class="token punctuation">(</span><span class="token maybe-class-name">Sprite1</span><span class="token punctuation">,</span><span class="token string">"http://192.168.11.5:8081/zt3.png"</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-8">方法列表 </h4>
<ul>
<li>setType---设置类型属性</li>
<li>setSpriteSize---设置精灵大小</li>
<li>setClick---设置点击事件</li>
<li>setSpriteOffset---设置锚点偏移</li>
</ul>
<h5 id="settype参数列表">setType参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>spriteType</td>
<td>spriteType</td>
<td>类型属性</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> spriteType <span class="token operator">=</span> <span class="token string">'2D'</span><span class="token comment">//2d、3d分别是相对于屏幕和场景</span>
mySprite<span class="token punctuation">.</span><span class="token method function property-access">setType</span><span class="token punctuation">(</span>spriteType<span class="token punctuation">)</span>
</code></pre><h5 id="setspritesize参数列表">setSpriteSize参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>size</td>
<td>Vector2</td>
<td>二维向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector2</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector2'</span>
<span class="token keyword keyword-const">const</span> <span class="token maybe-class-name">Vector2</span> <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span>
mySprite<span class="token punctuation">.</span><span class="token method function property-access">setSpriteSize</span><span class="token punctuation">(</span><span class="token maybe-class-name">Vector2</span><span class="token punctuation">)</span>
</code></pre><h5 id="setclick参数列表-1">setClick参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>fun</td>
<td>Function</td>
<td>方法</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>mySprite<span class="token punctuation">.</span><span class="token method function property-access">setClick</span><span class="token punctuation">(</span><span class="token keyword keyword-function">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>city<span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token string">'clickSprite'</span><span class="token punctuation">)</span>
    <span class="token function">clickTh</span><span class="token punctuation">(</span>city<span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="setspriteoffset参数列表">setSpriteOffset参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>fun</td>
<td>Function</td>
<td>方法</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector2</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector2'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span>
mySprite<span class="token punctuation">.</span><span class="token method function property-access">setSpriteOffset</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="注记类text">注记类（Text） </h1>
<h3 id="引入-9">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Text</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/Text'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-8">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myText <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Text</span><span class="token punctuation">(</span><span class="token string">'mytext'</span><span class="token punctuation">,</span><span class="token string">'mytext'</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-9">方法列表 </h4>
<ul>
<li>setLongLat---设置位置</li>
<li>setClick---设置点击事件</li>
<li>setTextOffset---设置锚点偏移</li>
</ul>
<h5 id="setlonglat参数列表-1">setLongLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>any</td>
<td>坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">113.8</span><span class="token punctuation">,</span><span class="token number">31.25</span><span class="token punctuation">,</span><span class="token number">20000.0</span><span class="token punctuation">)</span>
myText<span class="token punctuation">.</span><span class="token method function property-access">setLongLat</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><h5 id="setclick参数列表-2">setClick参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>fun</td>
<td>Function</td>
<td>方法</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myText<span class="token punctuation">.</span><span class="token method function property-access">setClick</span><span class="token punctuation">(</span><span class="token keyword keyword-function">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>city<span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">,</span><span class="token string">'clickText'</span><span class="token punctuation">)</span>
    <span class="token function">clickTh</span><span class="token punctuation">(</span>city<span class="token punctuation">.</span><span class="token property-access">name</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="settextoffset参数列表">setTextOffset参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>fun</td>
<td>Function</td>
<td>方法</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector2</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector2'</span>
<span class="token keyword keyword-const">const</span> position <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span>
myText<span class="token punctuation">.</span><span class="token method function property-access">setTextOffset</span><span class="token punctuation">(</span>position<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="wall类wall">Wall类（Wall） </h1>
<h3 id="引入-10">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Wall</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/Wall'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-9">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myWall <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Wall</span><span class="token punctuation">(</span><span class="token string">'武汉'</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-10">方法列表 </h4>
<ul>
<li>setMaterial---设置材质</li>
<li>build---构造围墙</li>
</ul>
<h5 id="setmaterial参数列表-1">setMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>material</td>
<td>Material</td>
<td>材质</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Material</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Material/Material'</span>
<span class="token keyword keyword-const">const</span> material <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Material</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.5</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
myWall<span class="token punctuation">.</span><span class="token method function property-access">setMaterial</span><span class="token punctuation">(</span>material<span class="token punctuation">)</span>
</code></pre><h5 id="build参数列表-1">build参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myWall<span class="token punctuation">.</span><span class="token method function property-access">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="坐标转换类coord">坐标转换类（Coord） </h1>
<h3 id="引入-11">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">convert</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Convert'</span><span class="token punctuation">;</span>
</code></pre><h4 id="方法列表-11">方法列表 </h4>
<ul>
<li>lonLatToUE---wgs84坐标转ue世界坐标</li>
<li>UETolonLat---ue世界坐标转wgs84坐标</li>
<li>UEToPixel---ue世界坐标转屏幕坐标</li>
<li>pixelToUE---屏幕坐标转ue世界坐标</li>
<li>GCJTolonLat---高德坐标转wgs84坐标</li>
<li>BDTolonLat---百度坐标转wgs84坐标</li>
</ul>
<h5 id="lonlattoue参数列表">lonLatToUE参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
convert<span class="token punctuation">.</span><span class="token method function property-access">lonLatToUE</span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><h5 id="uetolonlat参数列表">UETolonLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
convert<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">UETolonLat</span></span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><h5 id="uetopixel参数列表">UEToPixel参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
convert<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">BDTolonLat</span></span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><h5 id="gcjtolonlat参数列表">GCJTolonLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114</span><span class="token punctuation">,</span><span class="token number">25</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">134</span><span class="token punctuation">,</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">112</span><span class="token punctuation">,</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lonLat <span class="token operator">=</span> convert<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">GCJTolonLat</span></span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><h5 id="bdtolonlat参数列表">BDTolonLat参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114</span><span class="token punctuation">,</span><span class="token number">25</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">134</span><span class="token punctuation">,</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">112</span><span class="token punctuation">,</span><span class="token number">24</span><span class="token punctuation">,</span><span class="token number">100</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lonLat <span class="token operator">=</span> convert<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">BDTolonLat</span></span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><h5 id="pixeltoue参数列表">pixelToUE参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector2></vector2></td>
<td>二维坐标数组</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token comment">// 支持以下几种格式</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector2</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector2'</span>
<span class="token keyword keyword-const">const</span> list1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> list3 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector2</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> lists <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
lists<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>list1<span class="token punctuation">,</span> list2<span class="token punctuation">,</span> list3<span class="token punctuation">)</span>
convert<span class="token punctuation">.</span><span class="token method function property-access">pixelToUE</span><span class="token punctuation">(</span>lists<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="地图类map">地图类（Map） </h1>
<h3 id="引入-12">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> refesh<span class="token punctuation">,</span> setElevationUrl<span class="token punctuation">,</span> setMapUrl <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Map/Map'</span><span class="token punctuation">;</span>
</code></pre><h4 id="方法列表-12">方法列表 </h4>
<ul>
<li>refesh---刷新</li>
<li>setElevationUrl---设置高程url</li>
<li>setMapUrl---设置地图url</li>
</ul>
<h5 id="refesh参数列表">refesh参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token function">refesh</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="setelevationurl参数列表">setElevationUrl参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>高层URL</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> url <span class="token operator">=</span> <span class="token string">'http://10.0.0.101:8080/dem/layer.json'</span>
<span class="token function">setElevationUrl</span><span class="token punctuation">(</span>url<span class="token punctuation">)</span>
</code></pre><h5 id="setmapurl参数列表">setMapUrl参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>地图URL</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> url <span class="token operator">=</span> <span class="token string">'http://10.0.0.101:8080/satelite/{z}/{x}/{y}.png'</span>
<span class="token function">setMapUrl</span><span class="token punctuation">(</span>url<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="服务类gisserver">服务类（GisServer） </h1>
<h3 id="引入-13">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">WMSServer</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../GisServer/WMSServer'</span><span class="token punctuation">;</span>
</code></pre><h3 id="初始化-10">初始化 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> myWMSServer <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">WMSServer</span><span class="token punctuation">(</span>
    <span class="token punctuation">{</span>
        <span class="token literal-property property">url</span><span class="token operator">:</span> <span class="token string">'http://10.0.0.25:8080/geoserver/hubei/wms'</span><span class="token punctuation">,</span> 
        <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'hubei:500and1000'</span><span class="token punctuation">,</span> <span class="token comment">// wms服务名称</span>
        <span class="token literal-property property">index</span><span class="token operator">:</span> <span class="token number">1</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h4 id="方法列表-13">方法列表 </h4>
<ul>
<li>setLayerIndex---设置图层层级</li>
<li>setLayerName---设置图层名称</li>
<li>removeLayer---移除图层</li>
</ul>
<h5 id="setlayerindex参数列表">setLayerIndex参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>number</td>
<td>层级</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> index <span class="token operator">=</span> <span class="token number">1</span>
myWMSServer<span class="token punctuation">.</span><span class="token method function property-access">setLayerIndex</span><span class="token punctuation">(</span>index<span class="token punctuation">)</span>
</code></pre><h5 id="setlayername参数列表">setLayerName参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>图层名称</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> name <span class="token operator">=</span> <span class="token string">'wmsserver1'</span>
myWMSServer<span class="token punctuation">.</span><span class="token method function property-access">setLayerName</span><span class="token punctuation">(</span>name<span class="token punctuation">)</span>
</code></pre><h5 id="removelayer参数列表">removeLayer参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>myWMSServer<span class="token punctuation">.</span><span class="token method function property-access">removeLayer</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="高亮描边类outline">高亮描边类（OutLine） </h1>
<h3 id="引入-14">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token maybe-class-name">OutLine</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Pass/OutLine'</span>
</code></pre><h4 id="方法列表-14">方法列表 </h4>
<ul>
<li>setOutLine---设置高亮描边</li>
<li>removeOutLine---删除高亮描边</li>
</ul>
<h5 id="setoutline参数列表">setOutLine参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>模型ID</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> id <span class="token operator">=</span> <span class="token string">'XXXXXX'</span>
<span class="token maybe-class-name">OutLine</span><span class="token punctuation">.</span><span class="token method function property-access">setOutLine</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span>
</code></pre><h5 id="removeoutline参数列表">removeOutLine参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>模型ID</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> id <span class="token operator">=</span> <span class="token string">'XXXXXX'</span>
<span class="token maybe-class-name">OutLine</span><span class="token punctuation">.</span><span class="token method function property-access">removeOutLine</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="天际线skyline">天际线（skyLine） </h1>
<h3 id="引入-15">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">skyLine</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Pass/skyLine'</span>
</code></pre><h4 id="方法列表-15">方法列表 </h4>
<ul>
<li>openSkyLine---开启天际线</li>
<li>removeSkyLine---关闭天际线</li>
</ul>
<h5 id="setoutline参数列表-1">setOutLine参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>Number</td>
<td>天际线宽度</td>
</tr>
<tr>
<td>color</td>
<td>Vector3</td>
<td>天际线rgb颜色</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
skyLine<span class="token punctuation">.</span><span class="token method function property-access">openSkyLine</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre><h5 id="removeskyline参数列表">removeSkyLine参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
skyLine<span class="token punctuation">.</span><span class="token method function property-access">openSkyLine</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token maybe-class-name">OutLine</span><span class="token punctuation">.</span><span class="token method function property-access">removeSkyLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="datasmith模型类datasmith">DataSmith模型类（DataSmith） </h1>
<h3 id="引入-16">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">DataSmith</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/DataSmith'</span>
</code></pre><h4 id="方法列表-16">方法列表 </h4>
<ul>
<li>setUrl---开启对象平移方法</li>
<li>setLonLatPosition---开启对象缩放方法</li>
<li>getModelByName---开启对象旋转方法</li>
<li>setModelVisible---设置模型显示隐藏</li>
<li>setModelAlpha---设置模型透明度</li>
<li>setModelRotate---设置模型旋转</li>
<li>modelDestroy---设置模型旋转</li>
<li>getNode---获取模型结构树</li>
<li>copyMode---模型复制</li>
<li>modelHighLight---模型高亮</li>
</ul>
<h5 id="transformlcontral参数列表">transformlContral参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>uuid</td>
<td>string</td>
<td>对象uuid</td>
</tr>
<tr>
<td>tag</td>
<td>string</td>
<td>对象标签</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code> <span class="token keyword keyword-const">const</span> modelA <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DataSmith</span><span class="token punctuation">(</span><span class="token string">'newModel'</span><span class="token punctuation">)</span>
 modelA<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'巷冲35kV变电站'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">data</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
    editModel<span class="token punctuation">.</span><span class="token method function property-access">startEditModel</span><span class="token punctuation">(</span>modelA<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="模型编辑类transformlcontral">模型编辑类（TransformlContral） </h1>
<h3 id="引入-17">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">editModel</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../transformlContral/transformlContral'</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">DataSmith</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Object3D/DataSmith'</span>
</code></pre><h4 id="方法列表-17">方法列表 </h4>
<ul>
<li>startEditModel---开启对象平移方法</li>
<li>startScaleModel---开启对象缩放方法</li>
<li>startRotateModel---开启对象旋转方法</li>
<li>stopEditModel---结束对象编辑方法</li>
<li>fallGround---对象落地方法</li>
</ul>
<h5 id="starteditmodel参数列表">startEditModel参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
<th>必填</th>
</tr>
</thead>
<tbody>
<tr>
<td>uuid</td>
<td>string</td>
<td>对象uuid</td>
<td>true</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code> <span class="token keyword keyword-const">const</span> modelA <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DataSmith</span><span class="token punctuation">(</span><span class="token string">'newModel'</span><span class="token punctuation">)</span>
 modelA<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'E:/uepack/newmain/Windows/UESDK/Content/dataSmithModel/model/巷冲35kV变电站.udatasmith'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">data</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
    editModel<span class="token punctuation">.</span><span class="token method function property-access">startEditModel</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token literal-property property">uuid</span><span class="token operator">:</span>modelA<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="startscalemodel参数列表">startScaleModel参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
<th>必填</th>
</tr>
</thead>
<tbody>
<tr>
<td>uuid</td>
<td>string</td>
<td>对象uuid</td>
<td>true</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code> <span class="token keyword keyword-const">const</span> modelA <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DataSmith</span><span class="token punctuation">(</span><span class="token string">'newModel'</span><span class="token punctuation">)</span>
 modelA<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'E:/uepack/newmain/Windows/UESDK/Content/dataSmithModel/model/巷冲35kV变电站.udatasmith'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">data</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
    editModel<span class="token punctuation">.</span><span class="token method function property-access">startScaleModel</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token literal-property property">uuid</span><span class="token operator">:</span>modelA<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="stopeditmodel参数列表">stopEditModel参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>    editModel<span class="token punctuation">.</span><span class="token method function property-access">stopEditModel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="startrotatemodel参数列表">startRotateModel参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
<th>必填</th>
</tr>
</thead>
<tbody>
<tr>
<td>uuid</td>
<td>string</td>
<td>对象uuid</td>
<td>true</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code> <span class="token keyword keyword-const">const</span> modelA <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DataSmith</span><span class="token punctuation">(</span><span class="token string">'newModel'</span><span class="token punctuation">)</span>
 modelA<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'E:/uepack/newmain/Windows/UESDK/Content/dataSmithModel/model/巷冲35kV变电站.udatasmith'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">data</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
    editModel<span class="token punctuation">.</span><span class="token method function property-access">startRotateModel</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token literal-property property">uuid</span><span class="token operator">:</span>modelA<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><h5 id="fallground参数列表">fallGround参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
<th>必填</th>
</tr>
</thead>
<tbody>
<tr>
<td>uuid</td>
<td>string</td>
<td>对象uuid</td>
<td>true</td>
</tr>
<tr>
<td>targetTag</td>
<td>string</td>
<td>目标地面标签</td>
<td>true</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code> <span class="token keyword keyword-const">const</span> modelA <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DataSmith</span><span class="token punctuation">(</span><span class="token string">'newModel'</span><span class="token punctuation">)</span>
 modelA<span class="token punctuation">.</span><span class="token method function property-access">setUrl</span><span class="token punctuation">(</span><span class="token string">'E:/uepack/newmain/Windows/UESDK/Content/dataSmithModel/model/巷冲35kV变电站.udatasmith'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">data</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
    editModel<span class="token punctuation">.</span><span class="token method function property-access">fallGround</span><span class="token punctuation">(</span><span class="token string">'terrain'</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token literal-property property">uuid</span><span class="token operator">:</span>modelA<span class="token punctuation">.</span><span class="token property-access">uuid</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">then</span><span class="token punctuation">(</span><span class="token parameter">val</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>val<span class="token punctuation">,</span><span class="token string">'地面位置'</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
 <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="面绘制aspects">面绘制（aspects） </h1>
<h3 id="引入-18">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports">aspects</span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../event/aspects'</span>
</code></pre><h4 id="方法列表-18">方法列表 </h4>
<ul>
<li>TwoAspects---开启两点构面</li>
<li>stopTwoAspects---结束两点编辑</li>
<li>multipoint---开启多点绘制面</li>
<li>removeAspects---移除所有面</li>
</ul>
<h5 id="twoaspects参数列表">TwoAspects参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>makeArea</td>
<td>boolean</td>
<td>是否构面</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  aspects<span class="token punctuation">.</span><span class="token method function property-access"><span class="token maybe-class-name">TwoAspects</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="stoptwoaspects参数列表">stopTwoAspects参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  aspects<span class="token punctuation">.</span><span class="token method function property-access">stopTwoAspects</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="multipoint参数列表">multipoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>makeArea</td>
<td>boolean</td>
<td>是否构面</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  aspects<span class="token punctuation">.</span><span class="token method function property-access">multipoint</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="removeaspects参数列表">removeAspects参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  aspects<span class="token punctuation">.</span><span class="token method function property-access">removeAspects</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="绘制水drawwater">绘制水（drawWater） </h1>
<h3 id="引入-19">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span>drawWater<span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../event/drawWater'</span>
</code></pre><h4 id="方法列表-19">方法列表 </h4>
<ul>
<li>draw---开始绘制</li>
<li>stopWater---停止绘制</li>
<li>newWaterMaterial---更新水材质</li>
<li>removeWater---移除所有水面</li>
</ul>
<h5 id="draw参数列表">draw参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>   <span class="token keyword keyword-const">const</span> mywater <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">drawWater</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
   mywater<span class="token punctuation">.</span><span class="token method function property-access">draw</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="stopwater参数列表">stopWater参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  mywater<span class="token punctuation">.</span><span class="token method function property-access">stopWater</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="newwatermaterial参数列表">newWaterMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>material</td>
<td>Material</td>
<td>材质颜色</td>
</tr>
<tr>
<td>WaveStrength</td>
<td>number</td>
<td>波浪大小</td>
</tr>
<tr>
<td>FlowSpeed</td>
<td>number</td>
<td>水面流速</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Vector3</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Math/Vector3'</span>
  <span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Material</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../Material/Material'</span>
  <span class="token keyword keyword-const">const</span> material <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Material</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
  mywater<span class="token punctuation">.</span><span class="token method function property-access">newWaterMaterial</span><span class="token punctuation">(</span>material<span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre><h5 id="removewater参数列表">removeWater参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  mywater<span class="token punctuation">.</span><span class="token method function property-access">removeWater</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h1 id="天气组件setweather">天气组件（setWeather） </h1>
<h3 id="引入-20">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span>setWeather<span class="token punctuation">,</span> setCloudNum<span class="token punctuation">,</span> setCloudHeight<span class="token punctuation">,</span> setCloudSpeed<span class="token punctuation">,</span> setFogNum<span class="token punctuation">,</span> removeWeather<span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../weather/setWeather'</span>
</code></pre><h4 id="方法列表-20">方法列表 </h4>
<ul>
<li>setWeather---设置天气</li>
<li>setCloudNum---设置云密度</li>
<li>setCloudHeight---设置大气高度</li>
<li>setCloudSpeed---设置云速度</li>
<li>setFogNum---设置雾密度</li>
<li>removeWeather---移除天气</li>
</ul>
<h5 id="setweather参数列表">setWeather参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>weatherType</td>
<td>weather</td>
<td>天气类型</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcloudnum参数列表">setCloudNum参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>cloudNum</td>
<td>number</td>
<td>云密度</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
  <span class="token function">setCloudNum</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcloudheight参数列表">setCloudHeight参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>cloudHeight</td>
<td>number</td>
<td>大气高度</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
  <span class="token function">cloudHeight</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span>
</code></pre><h5 id="setcloudspeed参数列表">setCloudSpeed参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>setCloudSpeed</td>
<td>number</td>
<td>云速度</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
  <span class="token function">setCloudSpeed</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span>
</code></pre><h5 id="setfognum参数列表">setFogNum参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>fogNum</td>
<td>number</td>
<td>雾密度</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
  <span class="token function">setFogNum</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span>
</code></pre><h5></h5>
<p>removeWeather参数列表</p>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>   <span class="token function">setWeather</span><span class="token punctuation">(</span><span class="token string">'rain'</span><span class="token punctuation">)</span>
   <span class="token function">removeWeather</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="围栏绘制drawwall">围栏绘制（drawWall） </h1>
<h3 id="引入-21">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span>drawWall<span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../event/drawWall'</span>
</code></pre><h4 id="方法列表-21">方法列表 </h4>
<ul>
<li>draw---开始绘制</li>
<li>stopWall---停止绘制</li>
<li>removeWall---移除围栏</li>
<li>newWallMaterial---更换材质</li>
</ul>
<h5 id="draw参数列表-1">draw参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword keyword-const">const</span> myWall <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">drawWall</span><span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment">// 初始化，默认高度10，默认纹理蓝色渐变条纹</span>
  <span class="token keyword keyword-const">const</span> <span class="token maybe-class-name">WallMaterial</span> <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">WallMaterial</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0.169083</span><span class="token punctuation">,</span><span class="token number">0.149388</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">0</span> <span class="token punctuation">,</span><span class="token number">1</span> <span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span>
  <span class="token keyword keyword-const">const</span> myWall <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">drawWall</span><span class="token punctuation">(</span><span class="token number">100</span>，WallMaterial<span class="token punctuation">)</span>  <span class="token comment">//初始化设置墙面高度，墙面纹理</span>
  myWall<span class="token punctuation">.</span><span class="token method function property-access">draw</span><span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment">//开始绘制</span>
</code></pre><h5 id="stopwall参数列表">stopWall参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  myWall<span class="token punctuation">.</span><span class="token method function property-access">stopWall</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="removewall参数列表">removeWall参数列表 </h5>
<table>
<thead>
<tr>
<th>无</th>
</tr>
</thead>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  myWall<span class="token punctuation">.</span><span class="token method function property-access">removeWall</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><h5 id="newwallmaterial参数列表">newWallMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>material</td>
<td>WallMaterial</td>
<td>围墙材质</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">WallMaterial</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../Material/WallMaterial'</span>
  <span class="token keyword keyword-const">const</span> tiao2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">WallMaterial</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">0</span> <span class="token punctuation">,</span><span class="token number">0</span> <span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token comment">//第一个参数是颜色需要归一化，第二个是渐变取值为0-100，第三个是条纹流动纹理取值0或者1，第四个是斜纹纹理取值0或者1</span>
  myWall<span class="token punctuation">.</span><span class="token method function property-access">newWallMaterial</span><span class="token punctuation">(</span>tiao2<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="求两点距离distance">求两点距离（Distance） </h1>
<h3 id="引入-22">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Distance</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../Math/Distance'</span>
</code></pre><h4 id="方法列表-22">方法列表 </h4>
<ul>
<li>linearDistance---计算直线距离</li>
<li>sphericalDistance---计算球面距离</li>
</ul>
<h5 id="lineardistance参数列表">linearDistance参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>pointA</td>
<td>Vector3</td>
<td>第一个点坐标</td>
</tr>
<tr>
<td>pointB</td>
<td>Vector3</td>
<td>第二个点坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword keyword-const">const</span> po1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.316106446445</span><span class="token punctuation">,</span><span class="token number">30.5646010980166</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span>
  <span class="token keyword keyword-const">const</span> po2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.324529738406</span><span class="token punctuation">,</span><span class="token number">30.5560350383956</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span>
  <span class="token keyword keyword-const">const</span> juli <span class="token operator">=</span> <span class="token maybe-class-name">Distance</span><span class="token punctuation">.</span><span class="token method function property-access">linearDistance</span><span class="token punctuation">(</span>po1<span class="token punctuation">,</span> po2<span class="token punctuation">)</span>
</code></pre><h5 id="sphericaldistance参数列表">sphericalDistance参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>pointA</td>
<td>Vector3</td>
<td>第一个点坐标</td>
</tr>
<tr>
<td>pointB</td>
<td>Vector3</td>
<td>第二个点坐标</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword keyword-const">const</span> po1 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.316106446445</span><span class="token punctuation">,</span><span class="token number">30.5646010980166</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span>
  <span class="token keyword keyword-const">const</span> po2 <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.324529738406</span><span class="token punctuation">,</span><span class="token number">30.5560350383956</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span>
  <span class="token keyword keyword-const">const</span> juli <span class="token operator">=</span> <span class="token maybe-class-name">Distance</span><span class="token punctuation">.</span><span class="token method function property-access">sphericalDistance</span><span class="token punctuation">(</span>po1<span class="token punctuation">,</span> po2<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="求中心点calculatecenter">求中心点（CalculateCenter） </h1>
<h3 id="引入-23">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">CalculateCenter</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../Math/CalculateCenter'</span>
</code></pre><h4 id="方法列表-23">方法列表 </h4>
<ul>
<li>lonLatCenterPoint---计算地球球体坐标系下点集中心点</li>
<li>mathCenterPoint---计算空间直角坐标系下点集中心点</li>
</ul>
<h5 id="lonlatcenterpoint参数列表">lonLatCenterPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维向量集</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword keyword-const">const</span> list <span class="token operator">=</span><span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.316106446445</span><span class="token punctuation">,</span><span class="token number">30.5646010980166</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.324529738406</span><span class="token punctuation">,</span><span class="token number">30.5560350383956</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.323429778477</span><span class="token punctuation">,</span><span class="token number">30.5693306012377</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.318118821512</span><span class="token punctuation">,</span><span class="token number">30.5525411243805</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
    <span class="token keyword keyword-const">const</span> center <span class="token operator">=</span> <span class="token maybe-class-name">CalculateCenter</span><span class="token punctuation">.</span><span class="token method function property-access">lonLatCenterPoint</span><span class="token punctuation">(</span>list<span class="token punctuation">)</span>
</code></pre><h5 id="mathcenterpoint参数列表">mathCenterPoint参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Array<vector3></vector3></td>
<td>三维向量集</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code>  <span class="token keyword keyword-const">const</span> list <span class="token operator">=</span><span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.316106446445</span><span class="token punctuation">,</span><span class="token number">30.5646010980166</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.324529738406</span><span class="token punctuation">,</span><span class="token number">30.5560350383956</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.323429778477</span><span class="token punctuation">,</span><span class="token number">30.5693306012377</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">114.318118821512</span><span class="token punctuation">,</span><span class="token number">30.5525411243805</span><span class="token punctuation">,</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">]</span>
    <span class="token keyword keyword-const">const</span> center <span class="token operator">=</span> <span class="token maybe-class-name">CalculateCenter</span><span class="token punctuation">.</span><span class="token method function property-access">mathCenterPoint</span><span class="token punctuation">(</span>list<span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="图层类layer">图层类（layer） </h1>
<h3 id="引入-24">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span>layer<span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../layer'</span>
</code></pre><h4 id="方法列表-24">方法列表 </h4>
<ul>
<li>setLayerMaterial---设置图层材质</li>
<li>setLayerMetalness---设置图层金属光泽</li>
<li>setLayerColor---分层设色</li>
</ul>
<h5 id="setlayermaterial参数列表">setLayerMaterial参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>material</td>
<td>Material</td>
<td>材质类</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> layer <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Layer</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token keyword keyword-const">const</span> material <span class="token operator">=</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Material</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">,</span><span class="token number">0.0</span><span class="token punctuation">)</span>
layer<span class="token punctuation">.</span><span class="token method function property-access">setLayerMaterial</span><span class="token punctuation">(</span>material<span class="token punctuation">)</span>
</code></pre><h5 id="setlayermetalness参数列表">setLayerMetalness参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>metalness</td>
<td>Number</td>
<td>数值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> layer <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Layer</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
layer<span class="token punctuation">.</span><span class="token method function property-access">setLayerMetalness</span><span class="token punctuation">(</span><span class="token number">1.0</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="球类sphere">球类（sphere） </h1>
<h3 id="引入-25">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Sphere</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../sphere'</span>
</code></pre><h4 id="方法列表-25">方法列表 </h4>
<ul>
<li>setPosition---设置球体位置</li>
<li>setSize---设置球体大小</li>
<li>setColor---设置球体颜色</li>
</ul>
<h5 id="setposition参数列表-1">setPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>vector3</td>
<td>向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> sphere <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Sphere</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
sphere<span class="token punctuation">.</span><span class="token method function property-access">setPosition</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre><h5 id="setsize参数列表-1">setSize参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>size</td>
<td>Number</td>
<td>数值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> sphere <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Sphere</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
sphere<span class="token punctuation">.</span><span class="token method function property-access">setSize</span><span class="token punctuation">(</span><span class="token number">10.0</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="点类point">点类（point） </h1>
<h3 id="引入-26">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Point</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../point'</span>
</code></pre><h4 id="方法列表-26">方法列表 </h4>
<ul>
<li>setPosition---设置点的位置</li>
<li>setSize---设置点的大小</li>
<li>setColor---设置点的颜色</li>
</ul>
<h5 id="setposition参数列表-2">setPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>vector3</td>
<td>向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> point <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Point</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
point<span class="token punctuation">.</span><span class="token method function property-access">setPosition</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre><h5 id="setsize参数列表-2">setSize参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>size</td>
<td>Number</td>
<td>数值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> point <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Point</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
point<span class="token punctuation">.</span><span class="token method function property-access">setSize</span><span class="token punctuation">(</span><span class="token number">10.0</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="线类line">线类（line） </h1>
<h3 id="引入-27">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Line</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../line'</span>
</code></pre><h4 id="方法列表-27">方法列表 </h4>
<ul>
<li>setByPositionList---设置线的位置</li>
<li>setWidth---设置线的宽度</li>
<li>setColor---设置线的颜色</li>
</ul>
<h5 id="setbypositionlist参数列表">setByPositionList参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>positionList</td>
<td>Array<vector3></vector3></td>
<td>三维向量集</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> line <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Line</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
line<span class="token punctuation">.</span><span class="token method function property-access">setByPositionList</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">1000</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre><h5 id="setwidth参数列表">setWidth参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>width</td>
<td>Number</td>
<td>数值</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> line <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Line</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
line<span class="token punctuation">.</span><span class="token method function property-access">setWidth</span><span class="token punctuation">(</span><span class="token number">10.0</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="广告牌文字类billboardtext">广告牌文字类（billboardText） </h1>
<h3 id="引入-28">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">BillboardText</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../billboardText'</span>
</code></pre><h4 id="方法列表-28">方法列表 </h4>
<ul>
<li>setPosition---设置文字的位置</li>
<li>setText---设置文字</li>
<li>setColor---设置文字颜色</li>
</ul>
<h5 id="setposition参数列表-3">setPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>三维向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> billboardText <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">BillboardText</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
billboardText<span class="token punctuation">.</span><span class="token method function property-access">setPosition</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre><h5 id="settext参数列表">setText参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>text</td>
<td>String</td>
<td>文字</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> billboardText <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">BillboardText</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
billboardText<span class="token punctuation">.</span><span class="token method function property-access">setText</span><span class="token punctuation">(</span><span class="token string">'HELLO'</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="标牌类marklabel">标牌类（markLabel） </h1>
<h3 id="引入-29">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">MarkLabel</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../markLabel'</span>
</code></pre><h4 id="方法列表-29">方法列表 </h4>
<ul>
<li>setPosition---设置文字的位置</li>
<li>setText---设置文字</li>
<li>setColor---设置文字颜色</li>
</ul>
<h5 id="setposition参数列表-4">setPosition参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td>Vector3</td>
<td>三维向量</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> markLabel <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">MarkLabel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
markLabel<span class="token punctuation">.</span><span class="token method function property-access">setPosition</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre><h5 id="settext参数列表-1">setText参数列表 </h5>
<table>
<thead>
<tr>
<th>name</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>text</td>
<td>String</td>
<td>文字</td>
</tr>
</tbody>
</table>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> markLabel <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">MarkLabel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
markLabel<span class="token punctuation">.</span><span class="token method function property-access">setText</span><span class="token punctuation">(</span><span class="token string">'HELLO'</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="画线工具类drawlinetools">画线工具类（drawLineTools） </h1>
<h3 id="引入-30">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">DrawLineTools</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../drawLineTools'</span>
</code></pre><h4 id="方法列表-30">方法列表 </h4>
<ul>
<li>startDraw---开始绘制</li>
<li>endDraw---结束绘制</li>
<li>clear---清除绘制的线</li>
<li>getLength---获取绘制长度</li>
</ul>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> draw <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DrawLineTools</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
draw<span class="token punctuation">.</span><span class="token method function property-access">startDraw</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="光源特效类light">光源特效类（light） </h1>
<h3 id="引入-31">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Light</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../light'</span>
</code></pre><h4 id="方法列表-31">方法列表 </h4>
<ul>
<li>setPower---设置光源强度</li>
<li>setColor---设置光源颜色</li>
<li>setPosition---设置光源位置</li>
</ul>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> light <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Light</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
light<span class="token punctuation">.</span><span class="token method function property-access">setPower</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="绘制动态线类drawdynamicline">绘制动态线类（drawDynamicLine） </h1>
<h3 id="引入-32">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">DrawDynamicLine</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../drawDynamicLine'</span>
</code></pre><h4 id="方法列表-32">方法列表 </h4>
<ul>
<li>startDraw---开始绘制</li>
<li>endDraw---结束绘制</li>
<li>clear---清除绘制的线</li>
<li>getLength---获取绘制长度</li>
</ul>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> draw <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DrawDynamicLine</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
draw<span class="token punctuation">.</span><span class="token method function property-access">startDraw</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="画多边形工具类drawpolygon">画多边形工具类（drawPolygon） </h1>
<h3 id="引入-33">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">DrawPolygon</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../drawPolygon'</span>
</code></pre><h4 id="方法列表-33">方法列表 </h4>
<ul>
<li>startDraw---开始绘制</li>
<li>endDraw---结束绘制</li>
<li>clear---清除绘制的多边形</li>
<li>getArea---获取绘制面积</li>
</ul>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> draw <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">DrawPolygon</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
draw<span class="token punctuation">.</span><span class="token method function property-access">startDraw</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre><hr>
<h1 id="网格类grid">网格类（grid） </h1>
<h3 id="引入-34">引入 </h3>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span><span class="token maybe-class-name">Grid</span><span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'../../grid'</span>
</code></pre><h4 id="方法列表-34">方法列表 </h4>
<ul>
<li>getGrid---获取网格对象</li>
<li>setGridPosition---设置平面网格</li>
<li>setGridSize---设置网格大小</li>
</ul>
<pre data-role="codeBlock" data-info="javascript" class="language-javascript javascript"><code><span class="token keyword keyword-const">const</span> grid <span class="token operator">=</span> <span class="token keyword keyword-new">new</span> <span class="token class-name">Grid</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
grid<span class="token punctuation">.</span><span class="token method function property-access">setGridPosition</span><span class="token punctuation">(</span><span class="token keyword keyword-new">new</span> <span class="token class-name">Vector3</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
grid<span class="token punctuation">.</span><span class="token method function property-access">setGridSize</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span>
</code></pre>
      </div>
      
      
    
    
    
    
    
    
  
    </body></html>